Canonicalize test units with @safetestset#86
Closed
ChrisRackauckas-Claude wants to merge 1 commit into
Closed
Conversation
Wrap each independent test unit in its own `@safetestset` so it runs in
a fresh module (isolation between tests + world-age safety), matching
the canonical OrdinaryDiffEq structure.
Core (runtests.jl else-branch):
- The sampler distribution loops + their `test_samples` helper moved
into a self-contained test/sampler_tests.jl, wrapped in
`@safetestset "Sampler distribution tests"`.
- `@testset "BigFloat support"` -> test/bigfloat_tests.jl.
- `@testset "PassthroughRNG dispatch"` -> test/passthrough_rng_tests.jl.
- `@testset "Allocation Tests"` keeps including alloc_tests.jl, now
via `@safetestset`.
Each extracted file carries its own `using`/`import` lines.
QA (test/qa/qa.jl): the Aqua / JET / ExplicitImports plain `@testset`
blocks become `@safetestset`s, each including a self-contained file
(qa_aqua.jl / qa_jet.jl / qa_explicitimports.jl). The include() form is
used so `using JET` runs before the qualified `JET.@test_opt`/`@test_call`
macros are reached.
The GROUP dispatch ladder and all assertions are unchanged. Adds
SafeTestsets to the main test deps and to the QA env (test/qa/Project.toml,
which is activated separately).
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by the v1.2 folder conversion on sciml-testing-rollout (#85). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Wraps each independent test unit in its own
@safetestsetso it runs in a fresh module — giving isolation between tests and world-age safety, matching the canonical OrdinaryDiffEq test structure.Core (
test/runtests.jlelse-branch)test_sampleshelper they share moved into a self-containedtest/sampler_tests.jl, wrapped in@safetestset "Sampler distribution tests".@testset "BigFloat support"->test/bigfloat_tests.jl.@testset "PassthroughRNG dispatch"->test/passthrough_rng_tests.jl.@testset "Allocation Tests"keeps includingalloc_tests.jl, now via@safetestset.Each extracted file carries its own
using/importlines so the body is self-contained inside its fresh module.QA (
test/qa/qa.jl)The
Aqua/JET static analysis/ExplicitImportsplain@testsetblocks become@safetestsets, each including a self-contained file (qa_aqua.jl/qa_jet.jl/qa_explicitimports.jl). Theinclude()form is used sousing JETruns before the qualifiedJET.@test_opt/JET.@test_callmacros are reached (avoids the macro-not-yet-defined expansion order issue).Behavior preserved
SafeTestsetsto the main test deps and to the QA env (test/qa/Project.toml, which is activated separately).Verification
Verified locally with Julia 1.11:
GROUP=Core— all units pass (BigFloat 401, PassthroughRNG 5, Allocation 10; Sampler block runs, reports 0@tests because it useserror()-based checks exactly as before).GROUP=QA— Aqua 10, JET 6, ExplicitImports 2, all pass.Ignore until reviewed by @ChrisRackauckas.
🤖 Generated with Claude Code